package com.kaigejava.guanchazhemoshi.oo;

import lombok.Data;

/**
 * Created by kaigejava on 2019/8/11.
 * 面向对象的天气对象
 */
@Data
public class WeatherDataOO {
    public  WeatherDataOO (){}
    public WeatherDataOO( CurrentCoditionOO currentCoditionOO){
        this.currentCoditionOO = currentCoditionOO;
    }

    /**
     * 温度
     */
    private float temperatrue;

    /**
     * 气压
     */
    private float pressure;

    /**
     * 湿度
     */
    private float humidity;

    /**
     * 公告板对象
     */
    private CurrentCoditionOO currentCoditionOO;

    /**
     * 天气变化时候方法
     */
    public void dataChange(){
        currentCoditionOO.update(this.getTemperatrue(),this.getPressure(),this.getHumidity());
        //新公司对接时候，当天气变化时候，将信息同步给三方公司
        // kaiGeJavaCurrentCoditionOO.update(this.getTemperatrue(),this.getPressure(),this.getHumidity());
    }

    /**
     * 模拟气象站数据
     */
    public void setData(float temperatrue,float pressure,float humidity){
        this.temperatrue = temperatrue;
        this.pressure = pressure;
        this.humidity = humidity;
        dataChange();
    }
}
